/*
 * @Author       : Thyssen Wen
 * @Date         : 2022-09-05 14:09:48
 * @LastEditors  : Thyssen Wen
 * @LastEditTime : 2022-09-06 09:15:55
 * @Description  : Test File
 * @FilePath     : /cdesign-pattern/Iterator/test.cpp
 */
#include "Aggregate.h"
#include "Book.h"
#include "Iterator.h"
#include "BookShelf.h"
#include <iostream>


int main(int argc, char *argv[])
{
    BookShelf<Book> *bookshelf_ptr = new BookShelf<Book>(4);
    bookshelf_ptr->appendBook(Book("Around the world in 80 Days"));
    bookshelf_ptr->appendBook(Book("Bible"));
    bookshelf_ptr->appendBook(Book("Cinderella"));
    bookshelf_ptr->appendBook(Book("Daddy-Long-Legs"));
    Iterator<Book> *it = bookshelf_ptr->iterator();
    while (it->hasNext())
    {
        Book* book = it->next();
        std::cout << book->getName() << std::endl;
    }
    return 0;
}